let print = false in

(* get input file and program arguments *)
let cmd, file, args = match Array.to_list Sys.argv with
[] -> raise (Failure "Check for sanity")
| _::[] -> raise (Failure "No input file")
| c::f::[] -> c, f, []
| c::f::a -> c, f, List.fold_left (fun l e ->
        (int_of_string e)::l) [] a
in

(* open code file *)
let code = open_in file
    (*try open_in file with
    Sys_error -> raise (Failure "Couldn't open file: " ^ file)*)
in

(* scan, parse, interpret *)
let lexbuf = Lexing.from_channel code in
let program = Parser.program Scanner.token lexbuf in
if print then
    print_string "No printer yet"
else
    let ret = Interpret.run program args in
    print_endline (string_of_int ret)

